package org.ucas.faker.web.entity;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Table(name = "depot", indexes = {
    @Index(name = "depot_name_index", columnList = "owner,name", unique = false)
})
@Entity
public class Depot extends IdEntity {

  @Column(name = "owner", nullable = false)
  private Long owner;

  @Column(name = "version", nullable = false)
  private Long version = 0L;

  @Column(name = "name", nullable = true)
  private String name;

  @Column(name = "deleted", nullable = false)
  private boolean deleted = false;

  @Column(name = "last_analysis", nullable = true)
  private Date lastAnalysis;

  @Column(name = "report_path", nullable = true)
  private String reportPath;

  public Long getOwner() {
    return owner;
  }

  public void setOwner(Long owner) {
    this.owner = owner;
  }

  public Long getVersion() {
    return version;
  }

  public void setVersion(Long version) {
    this.version = version;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  @Override
  public boolean isDeleted() {
    return deleted;
  }

  public void setDeleted(boolean deleted) {
    this.deleted = deleted;
  }

  public Date getLastAnalysis() {
    return lastAnalysis;
  }

  public void setLastAnalysis(Date lastAnalysis) {
    this.lastAnalysis = lastAnalysis;
  }

  public String getReportPath() {
    return reportPath;
  }

  public void setReportPath(String reportPath) {
    this.reportPath = reportPath;
  }
}
